import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {CommonTool} from '../common.tool';
import {HTTP_URLS} from '../../base/base-http.url';
import {Observable} from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class UploadFileService {


  constructor(private http: HttpClient,
              public commonTool: CommonTool) {

  }


  /**
   * 创建文件
   */
  public createFile(data: { name; folderId; folders; hashCode; size }): Observable<UploadDto> {
    return this.http.post<UploadDto>(HTTP_URLS.createFile, data);
  }


}

// 上传文件返回参数
export class UploadDto {
  public fid;
  public hashCode;
  public finish;
  public uploadUrl;
}
